<?php

/**
 * @author Martin Pernica
 * @copyright 2008
 */
$id = explode('-', $q[1]);

if(!empty($id[0])){
    
	$query = Registry::get('db')->query("SELECT * FROM {prefix}custom WHERE id = '".intval($id[0])."' LIMIT 1");
	$data = $query->fetch_array();
    
	if($query->num_rows != 0){
	   
	if(intval($_SESSION['rank']) >= $data['require_rank']){
    self::setTitle(stripslashes($data['title']));
	echo '<div class="com_custom">';
	echo '<h2 class="com_custom_title">'.stripslashes($data['title']).'</h2>';
	echo '<br />';
	echo $data['content'];
	echo '</div>';
    
	}else{
		self::setTitle('Chyba 403');
		Text::h3( Lang::getBack('com_custom', 'error_403') );
	}
	}else{
        self::setTitle('Chyba 404');
		require './templates/404.php';
	}
    
}
?>